Skip to content

fix(router): pin Codex auto review to OpenAI - #833

Merged
Ingwannu merged 2 commits into
devfrom
agent/fix-codex-auto-review-routing-816
Aug 1, 2026
Merged

fix(router): pin Codex auto review to OpenAI#833
Ingwannu merged 2 commits into
devfrom
agent/fix-codex-auto-review-routing-816

Conversation

@Ingwannu

@Ingwannu Ingwannu commented Aug 1, 2026

Copy link
Copy Markdown
Owner

What changed

  • recognize codex-auto-review as an exact Codex internal model id
  • route it only through the canonical enabled openai provider
  • fail closed when canonical OpenAI is unavailable
  • keep unknown codex-* third-party ids on the normal routing path

Why

The internal approval model did not match the public GPT/o family prefixes and could be sent to an unrelated default provider.

Closes #816

Checks

  • bun test tests/router.test.ts
  • bun x tsc --noEmit

Summary by CodeRabbit

  • Bug Fixes

    • Improved routing for supported bare OpenAI-family model IDs, including Codex models.
    • Preserved correct handling for third-party Codex models and slash-qualified model IDs.
    • Added clearer error handling when no OpenAI provider is available.
  • Tests

    • Added coverage for Codex routing, provider selection, and unavailable-provider scenarios.

@github-actions github-actions Bot added the bug Something isn't working label Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Ingwannu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9cb5e571-d5a5-46af-bd0d-fa3c3c16876e

📥 Commits

Reviewing files that changed from the base of the PR and between f806372 and 514b91e.

📒 Files selected for processing (1)
  • tests/router.test.ts
📝 Walkthrough

Walkthrough

The router now recognizes codex-auto-review as a bare OpenAI-family model. Tests verify canonical OpenAI routing, configured API-key routing, account mode, model IDs, and fail-closed behavior when OpenAI is unavailable.

Changes

Codex routing

Layer / File(s) Summary
Internal model allowlist
src/router.ts:309-315
Adds codex-auto-review to the exact bare OpenAI-family model set. Slash-qualified model IDs remain excluded.
Routing regression coverage
tests/router.test.ts:142-150, tests/router.test.ts:157
Verifies canonical openai routing, configured openai-apikey routing, expected model IDs and account mode, and NoEnabledOpenAiProviderError when OpenAI is unavailable.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: wibias, lidge-jun

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: routing Codex auto review through the canonical OpenAI provider.
Linked Issues check ✅ Passed src/router.ts and tests/router.test.ts satisfy issue #816 by pinning codex-auto-review to OpenAI, failing closed, and preserving third-party routing.
Out of Scope Changes check ✅ Passed The changes are limited to router recognition and focused regression tests for codex-auto-review behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/fix-codex-auto-review-routing-816

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/router.test.ts`:
- Around line 147-150: Extend the routing tests around routeModel to add a
fixture whose defaultProvider is a non-OpenAI provider such as deepseek, then
assert that the unknown bare codex-third-party-model resolves to that provider
while preserving the original model ID. Keep the existing openai-apikey case
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 15675967-5d79-4e5d-a40e-2e49f5999874

📥 Commits

Reviewing files that changed from the base of the PR and between f182f08 and f806372.

📒 Files selected for processing (2)
  • src/router.ts
  • tests/router.test.ts

Comment thread tests/router.test.ts
@Ingwannu
Ingwannu merged commit 75b903a into dev Aug 1, 2026
15 of 16 checks passed
@Ingwannu
Ingwannu deleted the agent/fix-codex-auto-review-routing-816 branch August 1, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant